package com.xywh.micro_warehousing.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xywh.micro_warehousing.R;
import com.xywh.micro_warehousing.mvp.ui.entity.Material;

import org.simple.eventbus.EventBus;

import java.util.List;


public class Tab2ShenQingYuLiuLieBiaoAdapter extends BaseQuickAdapter<Material.DataBean, BaseViewHolder> {

    private Context mContext;

    public Tab2ShenQingYuLiuLieBiaoAdapter(Context context, @Nullable List<Material.DataBean> data) {
        super(R.layout.item_tab2_shen_qing_yu_liu, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, Material.DataBean item) {
        //GlideUtil.loadImage(mContext,item.getImg(),helper.getView(R.id.img_head));0
        helper.setText(R.id.tv_material_description, "物资描述：" + item.getMaterial());
        helper.setText(R.id.tv_shen_qing_shu_liang, "申请数量：" + item.getMNum());
        helper.setText(R.id.tv_gui_zi_bian_hao, "柜子编号：" + item.getCounterId());
        helper.setText(R.id.tv_gui_zi_di_zhi, "柜子地址：" + item.getCounterAdd());
        helper.setOnClickListener(R.id.btn_kai_men, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EventBus.getDefault().post(item, "kaiMen");
            }
        });
    }

}
